<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 600px;
            height: 300px;
            margin: auto;
            text-align: center;
        }
        table {
            width: 500px;
        }
        table tr td {
            font-size: 16px;
            font-weight: normal;
        }
    </style>
</head>
<body>
  
    <script>
        let total = +prompt('请输入银行卡余额')
        let ele = +prompt('请输入电费')
        let water= +prompt('请输入水费')
        let web = +prompt('请输入网费')
        let balance = total - ele - water - web
        
        document.write(`  <div>
        <h4>2020年12月消费支出</h4>
        <table border="1" cellspacing="0" rules="all">
            <tr>
                <th>银行卡余额</th>
                <th>水费</th>
                <th>电费</th>
                <th>网费</th>
                <th>银行卡余额</th>
            </tr>
            <tr>
                <td>${total}元</td>
                <td>${ele}元</td>
                <td>${water}元</td>
                <td>${web}元</td>
                <td>${balance}元</td>
            </tr>
        </table>
    </div>`)
    </script>
</body>
</html>